diff -Nuar a/SConstruct b/SConstruct
--- a/SConstruct	2017-12-23 13:43:57.000000000 +0300
+++ b/SConstruct	2018-02-24 16:24:14.959394193 +0300
@@ -90,6 +90,29 @@
 
 env = Environment( tools=['default','scanreplace','pyuic','pyuic4','pyuic5','dbus','doxygen','pkgconfig'], toolpath=['admin'], ENV = buildenv, options=opts )
 
+if os.environ.has_key('CC'):
+	env['CC'] = os.environ['CC']
+
+if os.environ.has_key('CXX'):
+	env['CXX'] = os.environ['CXX']
+
+# grab OS CFLAGS / CCFLAGS
+if os.environ.has_key('CFLAGS'):
+	env['OS_CFLAGS'] = os.environ['CFLAGS']
+	env['CFLAGS'] = os.environ['CFLAGS']
+
+if os.environ.has_key('CCFLAGS'):
+	env['OS_CCFLAGS'] = os.environ['CCFLAGS']
+	env['CCFLAGS'] = os.environ['CCFLAGS']
+
+if os.environ.has_key('CXXFLAGS'):
+	env['OS_CCFLAGS'] = os.environ['CXXFLAGS']
+	env['CXXFLAGS'] = os.environ['CXXFLAGS']
+
+if os.environ.has_key('CPPFLAGS'):
+	env['OS_CPPFLAGS'] = os.environ['CPPFLAGS']
+	env['CPPFLAGS'] = os.environ['CPPFLAGS']
+
 custom_flags = False
 
 if 'COMPILE_FLAGS' in env and len(env['COMPILE_FLAGS']) > 0:
